package com.tianqu.tms.www.transfer.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.DateUtil;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.entity.Codes;
import com.tianqu.tms.entity.TransferAcceptedInfo;
import com.tianqu.tms.www.transfer.viewhelper.TransferRgInputViewHelper;
/**
 * 进入超期过期解锁首页
 * @author Administrator
 *
 */
public class TransferSeniorUnchainInputAction extends TmsAction {

	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {
		TransferRgInputViewHelper view = new TransferRgInputViewHelper();
		if(uc.getAttribute(TmsConstants.VIEWHELP)!=null)
		{
			view = (TransferRgInputViewHelper)uc.getAttribute(TmsConstants.VIEWHELP);
		}
		String serial = request.getParameter("serial");
	    TransferAcceptedInfo accept = new TransferAcceptedInfo();
	    accept = accept.getAssessInfoBySerial(serial);
		//页面显示流水号和过户状态 outTimePrice;
		view.setSerial(serial);
		Codes code = Codes.getInstance();
		String status = String.valueOf(accept.getWaitForStatus());
		view.setStatus(status);
		view.setAgentTime(DateUtil.getTimeByTimeStamp1(accept.getAgentTime()));
		uc.setAttribute(TmsConstants.VIEWHELP, view);
		request.setAttribute(TmsConstants.VIEWHELP, view);
		return mapping.findForward(TmsConstants.SUCCESS);
	}

}
